
import 'dart:async';

import 'package:flutter/services.dart';

class TimesdkPlugin {
  static const MethodChannel _channel = MethodChannel('timesdk_plugin');
  
  static initTimesdkPlugin() {
    _channel.setMethodCallHandler((call) async {
      switch(call.method) {
        case "upload_fail": {
          String msg = call.arguments;
          break;
        }
        case "upload_success": {
          String msg = call.arguments;
          break;
        }
      }
      return null;
    });
  }

  static void initTimeSDK () async {
    await _channel.invokeMethod('initTimeSDK');
  }

  static collectMessage(params) async {
    await _channel.invokeMethod('collectMessage', params);
  }

  static void checkSdkPermission() async {
    await _channel.invokeMethod('checkSdkPermission');
  }
}
